package com.heima.search.controller;

import com.heima.common.dto.ResponseResult;
import com.heima.search.dto.ApArticleSearchDto;
import com.heima.search.service.IApAssociateWordsService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/api/v1/associate")
public class ApAssociateWordsController {


    @Autowired
    IApAssociateWordsService associateWordsService; // 联想词服务

    /**
     * 查询关联词
     * @param dto
     * @return
     */
    @PostMapping("/search")
    public ResponseResult search(@RequestBody ApArticleSearchDto dto){
        // 调用联想词服务, 完成联想词功能
        return associateWordsService.search(dto);
    }
}
